package com.stars.empoly.activity

import android.os.Bundle
import com.stars.empoly.adapter.HeartAdapter
import com.stars.empoly.base.MBRActivity
import com.stars.empoly.databinding.ActivityHeartBinding
import com.stars.empoly.utils.PopuBuyUtils
import com.stars.empoly.vmodel.HeartVModel

/**
 *on 2022/9/24
 */
class HeartActivity: MBRActivity<HeartVModel, HeartAdapter, ActivityHeartBinding>() {

    override fun init(savedInstanceState: Bundle?) {
        super.init(savedInstanceState)
        vm.index.observe(this){
            adapter().removeAt(it)
        }
        vm.bean.observe(this){
            //去下单

            PopuBuyUtils.show(context(),it,binding.ll)

        }
    }
    override fun vmClass(): Class<HeartVModel> {
        return HeartVModel::class.java
    }
    override fun binding(): ActivityHeartBinding {
        return ActivityHeartBinding.inflate(layoutInflater)
    }

    override fun initAdapter(): HeartAdapter {
        return HeartAdapter(vm)
    }

    override fun title(): String? {
        return "我的关注"
    }
}
